#pragma once
#include <vector>

template <class T>
class Rescrambler{
public:
	Rescrambler(const int onesNumber);
	void RescrambleData(const T & data, T & outData) const;

	int oneNumber;
};


template <class T>
Rescrambler<T>::Rescrambler(const int onesNumber)	{
	oneNumber = onesNumber;
}

template <class T>
void Rescrambler<T>::RescrambleData(const T & data, T & outdata) const
{
	int i, count=0;
	for (i = 0; i < data.size(); i++)
	{
		if (data[i] == 1){
			count++;
		}
		if (count != 5){
			outdata.push_back(data[i]);
		}
		else{
			outdata.push_back(data[i]);
			i++;
			count = 0;
		}
	}

}